package com.kfm.usermanagement.controller;

import com.kfm.usermanagement.model.Emp;
import com.kfm.usermanagement.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/emp")
public class EmpController {

    @Autowired
    private EmpService service;

    // /emp/list
    @RequestMapping("/list")
    @ResponseBody
    public List<Emp> list() {
        return service.findAll();
    }
}
